package com.cjw.pojo.dto.systemManage;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @author : cjw
 * @date: : 2022/3/1 20:03
 * @description : 审核列表DTO
 */
@Data
@ApiModel("审核列表DTO")
public class ExamineDTO {
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty("审核id")
    private Long id;

    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("类型")
    private String type;

    @ApiModelProperty("状态")
    private String state;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    @ApiModelProperty("添加时间")
    private Date addTime;

    @ApiModelProperty("审核意见")
    private String remark;

    @ApiModelProperty("管理员id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long adminId;

    public void changeType(Integer type) {
        if (type == 1)
            this.type = "生活分享";
        else if (type == 2)
            this.type = "计划";
        else if (type == 3)
            this.type = "朗读";
    }

    public void changeState(Integer state) {
        if (state == 1)
            this.state = "通过";
        else if (state == 2)
            this.state = "未通过";
        else if (state == 3)
            this.state = "等待处理";
    }
}
